public class Maopao {
    //冒泡排序
    public static void main(String[] args) {
        int[] num = {15,59,56,12,81,22,8,1};
        for (int i = 0; i < num.length ; i++) {
            for (int j = 0; j < num.length - 1 ; j++) {
                if (num[j] > num[j + 1]) {
                    int temp = num[j  + 1];
                    num[j + 1] = num[j];
                    num[j] = temp;
                }
            }
        }
        for (int a: num
             ) {
            System.out.println(a);
        }
    }
}
